package only.level5.railgun.ysartifactsimulation.artifact;

import only.level5.railgun.ysartifactsimulation.Bean.MainStatRollCalc;

public enum ArtifactWord {

    flatATK(1,311,"值攻击", MainStatRollCalc::flatATK),
    flatHP(2,4780,"值生命",MainStatRollCalc::flatHP),
    flatDef(3,0,"值防御",MainStatRollCalc::flatDef),
    percentATK(4,0.466,"百分比攻击",MainStatRollCalc::percentATK),
    percentHP(5,0.466,"百分比生命",MainStatRollCalc::percentHP),
    percentDEF(6,0.583,"百分比防御",MainStatRollCalc::percentDEF),
    elementalMastery(7,187,"精通",MainStatRollCalc::elementalMastery),
    energyRecharge(8,0.518,"充能",MainStatRollCalc::energyRecharge),
    critRate(9,0.311,"暴击率",MainStatRollCalc::critRate),
    critDamage(10,0.622,"暴击伤害",MainStatRollCalc::critDamage),
    healing(11,0.359,"治疗加成",MainStatRollCalc::healing),
    physicalDamage(12,0.583,"物理伤害",MainStatRollCalc::physicalDamage),
    hydroDamage(13,0.466,"水元素伤害",MainStatRollCalc::hydroDamage),
    pyroDamage(14,0.466,"火元素伤害",MainStatRollCalc::pyroDamage),
    cryoDamage(15,0.466,"冰元素伤害",MainStatRollCalc::cryoDamage),
    geoDamage(16,0.466,"岩元素伤害",MainStatRollCalc::geoDamage),
    electroDamage(17,0.466,"雷元素伤害",MainStatRollCalc::electroDamage),
    anemoDamage(18,0.466,"风元素伤害",MainStatRollCalc::anemoDamage),
    dendroDamage(19,0.466,"草元素伤害",MainStatRollCalc::dendroDamage),
    ;

    public static ArtifactWord getInstanceByCode(int code){
        ArtifactWord[] values = ArtifactWord.values();
        for (ArtifactWord am: values) {
            if(am.code == code){
                return am;
            }
        }
        return flatDef;
    }

    int code;
    double value;
    String desc;
    StatUpgradeFunction statUpgradeFunction;

    ArtifactWord(int code, double value, String desc, StatUpgradeFunction statUpgradeFunction) {
        this.code = code;
        this.value = value;
        this.desc = desc;
        this.statUpgradeFunction = statUpgradeFunction;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public double getValue() {
        return value;
    }

    public void setValue(double value) {
        this.value = value;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public StatUpgradeFunction getMainStatUpgradeFunction() {
        return statUpgradeFunction;
    }

    public void setMainStatUpgradeFunction(StatUpgradeFunction statUpgradeFunction) {
        this.statUpgradeFunction = statUpgradeFunction;
    }
}